package com.example.anliku.service.serviceImpl;

import com.example.anliku.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.example.anliku.mapper.ExampletypeMapper;
import com.example.anliku.entity.Exampletype;
import com.example.anliku.service.ExampletypeService;
@Service
public class ExampletypeServiceImpl implements ExampletypeService{

    @Resource
    private ExampletypeMapper exampletypeMapper;

    @Override
    public Message deleteByPrimaryKey(Integer exampleTypeCategoryId) {
        return exampletypeMapper.deleteByPrimaryKey(exampleTypeCategoryId)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(Exampletype record) {
        return exampletypeMapper.insert(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insertSelective(Exampletype record) {
        return exampletypeMapper.insertSelective(record)>0?Message.success(null).add(record.getExampleTypeCategoryId()):Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer exampleTypeCategoryId) {
        return Message.success(null).add(exampletypeMapper.selectByPrimaryKey(exampleTypeCategoryId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Exampletype record) {
        return exampletypeMapper.updateByPrimaryKeySelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(Exampletype record) {
        return exampletypeMapper.updateByPrimaryKey(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message selectAll() {
        return Message.success(null).add(exampletypeMapper.selectAll());
    }

}
